<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>提现申请</title>
<link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <!--font-awesome.css?v=4.4.0-->
    <link href="https://cdn.staticfile.org/font-awesome/4.4.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!--bootstrap.min.css-->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <!--custom.css-->
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/plugins/iCheck/custom.css"/>
	<!--style.css-->
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/style.css"/>
	<link rel="stylesheet" href="<%=basePath%>js/plugins/layer/skin/layer.css" />
	<!--jquery.min.js-->
	<script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div class="col-md-10">
    <ol class="breadcrumb">
        <li>电子银行</li>
        <li class="active">提现申请</li>
    </ol>
    <br />
    <br />
    <%-- <form class="form-horizontal m-t" id="commentForm" novalidate="novalidate" action="${pageContext.request.contextPath}/UserServlet/insert" method="post"> --%>
    <span style="margin-left: 100px" class="">请输入会员姓名和密码</span>
    <form role="form" class="form-inline" style="margin-left: 100px"  id="biaodan" action="${pageContext.request.contextPath}/UsersServlet/findById" method="post"> 
        <label for="name" class="sr-only">用户名</label>
            <input value="${name}" name="name" type="name" placeholder="请输入用户名" id="name" class="form-control">
        <label for="pwd" class="sr-only">密码</label>
            <input value="${pwd}" name="pwd" type="password" placeholder="请输入密码" id="pwd" class="form-control">
        <button type="button" class="btn btn-primary" id="tijiao">确定</button>
        <span>${err}</span>
 	</form>
  
<form class="form-horizontal m-t" id="moneyform" novalidate="novalidate" action="" method="post">
         <div class="form-group">
              <label class="col-sm-2 control-label">当前余额：</label>
                   <div class="col-sm-4">
                        <input value="" id="user_money" name="user_money" minlength="2" type="text" class="form-control" required="" aria-required="true">
                   </div>
           </div>
         <div class="form-group">
           	<label class="col-sm-2 control-label">提现金额：</label>
	            <div class="col-sm-4">
	         		<input id="money" type="text" class="form-control" name="money" required="" aria-required="true">
	         	</div>
	         	
         </div>
        
          <div class="form-group">
             <label class="col-sm-2 control-label">银行所在地址及支行详细名称：</label>
                 <div class="col-sm-4">
                     <input id="curl" type="url" class="form-control" name="url">
                 </div>
         </div>
         <div class="form-group">
             <label class="col-sm-2 control-label">银行名称：</label>
                  <div class="col-sm-4">
                  	<%-- <select name="bank"  class="form-control" style="width: 200px">
                       <c:forEach items="${bankList}" var="bank">
                            <option value="${bank.bank_name }">${bank.bank_name }</option>
                       </c:forEach>
                    </select> --%>
						 <input id="bank_name" type="url" class="form-control" name="bank_name">
                  </div>
         </div>
          <div class="form-group">
             <label class="col-sm-2 control-label">银行卡号：</label>
                  <div class="col-sm-4">
                       <input id="ccomment" name="comment" class="form-control" required="" aria-required="true">
             	  </div>
         </div>
         <input type="hidden" id="user" name="user" value="" />
         <input type="hidden" id="password" name="user_pass" value="" />
         <div class="form-group">
               <div class="col-sm-4 col-sm-offset-3">
                     <input id="ti" class="btn btn-primary zhuanzhang" type="button" value="提交申请" />
               </div>
         </div>
    </form>
    <div class="pag" style="margin-left:350px"> </div>
</div>
	
</body>
<!--jquery.min.js-->
<script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
<!--bootstrap.min.js-->
<script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<!--jquery.peity.min.js-->
<script src="<%=basePath%>js/plugins/peity/jquery.peity.min.js" type="text/javascript" charset="utf-8"></script>
<!--content.js-->
<script src="<%=basePath%>js/content.js" type="text/javascript" charset="utf-8"></script>
<!--icheck.min.js-->
<script src="<%=basePath%>js/plugins/iCheck/icheck.min.js" type="text/javascript" charset="utf-8"></script>
<!--peity-demo.js-->
<script src="<%=basePath%>js/demo/peity-demo.js" type="text/javascript" charset="utf-8"></script>
<!--layer.min.js-->
<script src="<%=basePath%>js/plugins/layer/layer.min.js" type="text/javascript" charset="utf-8"></script>
<!-- 分页的js -->
<script src="<%=basePath%>js/plugins/jquery-bootstrap-pagination/jquery-bootstrap-pagination.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=basePath%>js/plugins/toastr/toastr.min.js" type="text/javascript" charset="utf-8"></script>
<script>	

layer.open({
	  title: '提现说明'
	  ,content: '您好，根据公司的提现规定，每月10号之前申请提现，30号发放，20号之前申请提现，次月10号发放，每月30号之前申请提现，次月20号发放，提现有5%手续费（国际汇款费用，汇率差）。 谢谢!'
	  ,area:['500px', '300px']
	  ,shade: [0.8, '#393D49'] 
	  ,anim: 5
	});   

	/* 获取值 */
	$('#tijiao').click(function(){
		$.get('<%=basePath%>UsersServlet/findById',{"name":$('#name').val(),"pwd":$('#pwd').val()},function(data){
			if(data==0){
				layer.msg('账号或者密码错误',{icon: 5,offset:['180px','300px']},{
                	time:2000
                });
			}else{
				var zhangMoney = JSON.parse(data);
				$('#user_money').val(zhangMoney[0].user_money);
				$('#ccomment').val(zhangMoney[0].user_cardNo);
				$('#curl').val(zhangMoney[0].user_address);
				$('#bank_name').val(zhangMoney[0].bank_name);
				$('#user').val(zhangMoney[0].user_name);
				$('#password').val(zhangMoney[0].user_pwd);
				
				$('#ti').click(function(){
					$.get('<%=basePath%>UsersServlet/insert',{
						"name":$('#user').val(),
						"user_pass":$('#password').val(),
						"user_money":$('#user_money').val(),
						"money":$('#money').val(),
						"url":$('#curl').val(),
						"bank_name":$('#bank_name').val(),
						"comment":$('#ccomment').val()
						},function (s) {
							if(s==2){
				                layer.msg('请输入金额',{icon: 3,offset:['180px','300px']},{
				                	time:1000
				                });
							}else if(s==1){
				                layer.msg('提现成功',{icon: 1,offset:['180px','300px']},{
				                	time:1000
				                });
				            }else{
				            	  layer.msg('提现失败',{icon: 5,offset:['180px','300px']},{
					                	time:1000
					                });
				            }
				    }); 
				});
			}
		});
	});
	
	$(':text').each(function(){
    	$(this).blur(function(){
    		if($(this).val()!=''){
    			$(this).css("border","1px solid #1AB394");
    		}else{
    			 if($(this).attr('name')=='user_tuijian'||$(this).attr('name')=='user_email'){
    				$(this).css("border","1px solid #F8AC59");
    			}else{ 
    				$(this).css("border","1px solid red");
    			}
    		}
    	});
    });

	<%-- $('#ti').click(function(){
		$('#moneyform').submit();
		$.get('<%=basePath%>UsersServlet/insert',{"name":$('#user').val(),"pwd":$('#password').val(),"user_money":$('#user_money').val(),"money":$('#money').val(),"url":$('#curl').val(),"bank_name":('#bank_name').val(),"comment":$('#ccomment').val()},function (s) {
			 if(s==1){
	                layer.msg('成功',{
	                	time:1000
	                });
	            }else{
	                alert('失败');
	            }
	    });
	}); --%>

	
</script>
</html>